package com.kede.app.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-05-12
**/
@Entity
@Data
@Table(name="sy_leescore_order_goods")
public class LeescoreOrderGoods implements Serializable {
    /**
    * 
    */
    @ApiModelProperty(value = "id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    private Integer id;
    /**
    * 订单ID
    */
    @ApiModelProperty(value = "订单ID")
    @Column(name = "`order_id`")
    private Integer orderId;
    /**
    * 商品ID
    */
    @ApiModelProperty(value = "商品ID")
    @Column(name = "`goods_id`")
    private Integer goodsId;
    /**
    * 购买数量
    */
    @ApiModelProperty(value = "购买数量")
    @Column(name = "`buy_num`")
    private Integer buyNum;
    /**
    * 积分价格
    */
    @ApiModelProperty(value = "积分价格")
    @Column(name = "`score`")
    private BigDecimal score;
    /**
    * 货币价格
    */
    @ApiModelProperty(value = "货币价格")
    @Column(name = "`money`")
    private BigDecimal money;
    /**
    * 商品名称
    */
    @ApiModelProperty(value = "商品名称")
    @Column(name = "`goods_name`")
    private String goodsName;
    /**
    * 商品缩略图
    */
    @ApiModelProperty(value = "商品缩略图")
    @Column(name = "`goods_thumb`")
    private String goodsThumb;
    /**
    * 创建时间
    */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "`createtime`")
    private Integer createtime;

    /**
     * 物流单号
     */
    @ApiModelProperty(value = "物流单号")
    @Column(name = "`logis_no`",nullable = false)
    @NotBlank
    private String logisNo;
    /**
     * 物流名称
     */
    @ApiModelProperty(value = "物流名称")
    @Column(name = "`logis_name`",nullable = false)
    @NotBlank
    private String logisName;

    /**
     * 订单状态:-3=异常订单,-2=驳回, -1=取消订单,0=未支付,1=已支付,2=已发货,3=已签收,4=退货中,5=已退款
     */
    @ApiModelProperty(value = "订单状态:-3=异常订单,-2=驳回, -1=取消订单,0=未支付,1=已支付,2=已发货,3=已签收,4=退货中,5=已退款")
    @Column(name = "`order_status`")
    private Integer orderStatus;

    @ApiModelProperty(value = "快递公司编号")
    @Column(name = "`cp_code`")
    private String cpCode;

    @ApiModelProperty(value = "商品的选品说明")
    @Column(name = "type_info")
    private String typeInfo;

    public void copy(LeescoreOrderGoods source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
